package com.ruoyi.web.controller.TiebaChatUser.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 聊天对象对象 tieba_chat_user
 *
 * @author yong
 * @date 2025-03-09
 */
@Data
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName("tieba_chat_user")
@ApiModel(value = "TiebaChatUser", description = "聊天对象实体")
public class TiebaChatUser extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 聊天主键id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("聊天主键id")
    private Long id;

    /**
     * 用户id
     */
    @Excel(name = "用户id")
    @ApiModelProperty("用户id")
    private Long userId;

    /**
     * 部门
     */
    @Excel(name = "部门")
    @ApiModelProperty("部门")
    private Long deptId;

    /**
     * 用户名
     */
    @Excel(name = "用户名")
    @ApiModelProperty("用户名")
    private String username;

    /**
     * 头像
     */
    @Excel(name = "头像")
    @ApiModelProperty("头像")
    private String avatarUrl;

    /**
     * 最后一条消息
     */
    @Excel(name = "最后一条消息")
    @ApiModelProperty("最后一条消息")
    private String lastMessage;

    /**
     * 最后一条消息时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后一条消息时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("最后一条消息时间")
    private Date lastMessageTime;

    /**
     * 逻辑删除
     */
    @ApiModelProperty("逻辑删除")
    private Integer delFlag;

    /**
     * 聊天对象id
     */
    @Excel(name = "聊天对象id")
    @ApiModelProperty("聊天对象id")
    private Long chatUserId;

    // 添加构造函数
    public TiebaChatUser(Long userId, Long chatUserId,Long deptId, String avatarUrl, String username) {
        this.userId = userId;
        this.deptId = deptId;
        this.username = username;
        this.avatarUrl = avatarUrl;
        this.lastMessage = "你好";
        this.lastMessageTime = null;
        this.chatUserId = chatUserId;
    }

}
